[!if FPCPRT != ""]
	Copyright (c) 2011-2012 by MicroStrategy, Inc.  This copyrighted material
	is the confidential, unpublished property of MicroStrategy.  This
	copyright notice and any other copyright notices included in machine
	readable copies must be reproduced on all authorized copies.
[!endif]
//=======================================================================
[!output COPYRIGHT_MSG]
//
//		File:	StdAfx.h
//
//		Date:	[!output FPDATE]
//
//		Desc:	Include file for standard system include files, or project
//				specific include files that are used frequently, but are
//				changed infrequently.
//=======================================================================

#pragma once

[!if SOCKETS != ""]
#include <afxsock.h>		// MFC socket extensions
[!endif]
[!if CRichEditView != ""]
#include <afxrich.h>		// MFC rich edit classes
[!endif]
[!if ATL_SUPPORT != ""]

#define STRICT
#ifndef _WIN32_WINNT
[!if RFUNCS_DEFINED != ""]
#define _WIN32_WINNT 0x0502
[!else]
#define _WIN32_WINNT 0x0400
[!endif]
#endif
#define _ATL_APARTMENT_THREADED
[!if MFC_SUPPORT != ""]

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdisp.h>        // MFC Automation classes
[!endif]

#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module
[!if ATL_SERVERTYPE_DLL != ""]
extern CComModule _Module;
[!else]
class CExeModule : public CComModule
{
public:
	LONG Unlock();
	DWORD dwThreadID;
	HANDLE hEventShutdown;
	void MonitorShutdown();
	bool StartMonitor();
	bool bActivity;
};
extern CExeModule _Module;
[!endif]
#include <atlcom.h>
[!endif]

#define Int_32		int

[!if FPINCLUDES != ""]
[!output FPINCLUDES]
[!endif]

//=======================================================================
// MicroStrategy libraries
//=======================================================================
#import "M5FunPack.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
[!if FUNCNNSIM_COUNT || FUNCNNGEN_COUNT]
#pragma warning( disable : 4146)
#import "M5TypLib.dll" raw_interfaces_only, raw_native_types, rename_namespace("M5TypLib"), named_guids
#pragma warning( default : 4146)
[!endif]
//=======================================================================

//=======================================================================
// non-numeric parameter/property support
#define MAXSIZE_DATE_STR 20
#define MAXSIZE_CHAR_STR 256
typedef char DATE_STR[MAXSIZE_DATE_STR+1];
typedef char CHSTR[MAXSIZE_CHAR_STR+1];
EXTERN_C const IID IID_IDSSTime;
//=======================================================================

// error message macros
#define INIT_ERROR_MSG(msg)															\
if(wcslen(m_sErrMsg)==0)															\
	swprintf(m_sErrMsg, ERRMSG_BUFSIZE, L"%s: %s", FUNC_NAME, msg);

#define CHECK_HR(msg)																\
if(FAILED(hr))																		\
{																					\
	if(wcslen(m_sErrMsg)==0)														\
		swprintf(m_sErrMsg, ERRMSG_BUFSIZE, L"[0x%X]%s: %s", hr, FUNC_NAME, msg);	\
	return hr;																		\
}

[!if OLEDB != ""]
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
#include <atldbcli.h>
#include <afxoledb.h>
[!endif]
[!if PROJTYPE_DLG != ""]
[!if AUTOMATION != ""]

[!if VERBOSE != ""]
// This macro is the same as IMPLEMENT_OLECREATE, except it passes TRUE
//  for the bMultiInstance parameter to the COleObjectFactory constructor.
//  We want a separate instance of this application to be launched for
//  each automation proxy object requested by automation controllers.
[!endif]
#ifndef IMPLEMENT_OLECREATE2
#define IMPLEMENT_OLECREATE2(class_name, external_name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
	AFX_DATADEF COleObjectFactory class_name::factory(class_name::guid, \
		RUNTIME_CLASS(class_name), TRUE, _T(external_name)); \
	const AFX_DATADEF GUID class_name::guid = \
		{ l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } };
#endif // IMPLEMENT_OLECREATE2
[!endif]
[!endif]

//{{AFX_INSERT_LOCATION}}
// [!output INSERT_LOCATION_COMMENT]
